<template>
    <div class="">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;帮助中心问答详情</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-form  label-width="160px">
                <el-form-item label="问题：">
                    <div>
                        {{data.question}}
                    </div>
                </el-form-item>
                <el-form-item label="回答内容：">
                    <div v-html="data.content">
                      
                    </div>
                </el-form-item>
                 <el-form-item label="创建时间：">
                    <div>
                        {{data.create_date}}
                    </div>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="returnList">返回列表</el-button>
                </el-form-item>
            </el-form>
        </div>
       
    </div>
</template>
<script>
import { getHelpDetails } from '@/api/index/helpCenter'
export default {
    name:"helpDetails",
    data() {
        return {
            id:0, //详情id
            data:'',//数据
            imgList:[],//图集
        }
    },
    //实例创建
    created(){
        if(this.$route.query.id &&this.$route.query.id!=""){
            this.id = this.$route.query.id;
            this.getData();
        }else{
           this.$notify.info({title: '提示',message: '获取详情ID失败，请返回列表页重试！'});
        }
    },
    //方法
    methods: {
        //获取详情
        getData(){
            console.log(this.id)
            getHelpDetails(this.id).then(res=>{
                console.log(res);
                if(res.code==200){
                     var data = res.data;
                     this.data = data;
                }else{
                    this.$notify.error({
                        title: '异常',
                        offset: 100,
                        message: response.msg
                    });
                }

            })
        },
        //返回列表
        returnList (){
          this.$router.go(-1);
        }
    }
}
</script>
<style lang="stylus" scoped>
    .el-form-item .el-cascader{
        width :400px;
    }
    .el-cascader-menus .el-cascader-menu{
        width :240px
    }
</style>


